<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">

    <title>文章管理页</title>
    <link rel="shortcut icon" href="/favicon.ico">

    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <link href="/public/admin/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="/public/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/public/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/public/admin/css/animate.css" rel="stylesheet">
    <link href="/public/admin/css/style.css?v=4.0.0" rel="stylesheet">
    <link href="/public/admin/css/ourstyle.css?v=4.0.0" rel="stylesheet">
    <link href="/public/admin/js/plugins/layer/skin/layer.css" rel="stylesheet">
    <!-- 全局js -->
    <script src="/public/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/public/admin/js/bootstrap.min.js?v=3.3.5"></script>
    <!-- 自定义js -->
    <script src="/public/admin/js/content.js?v=1.0.0"></script>
    <script src="/public/admin/js/plugins/layer/layer.min.js"></script>
    <script src="/public/admin/plugins/laydate/laydate.js"></script>
    <script src="/public/admin/js/article.js"></script>
    <script src="/public/admin/js/common.js"></script>
    <!-- CKeditor -->
    <script src="/public/admin/plugins/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="/public/admin/plugins/ckfinder/ckfinder.js"></script>
    <!-- iCheck -->
    <script src="/public/admin/js/plugins/iCheck/icheck.min.js"></script>
</head>

<body class="fixed-sidebar full-height-layout gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title" style="display:none">
                    <h5>文章内容</h5>
                </div>
                <div class="ibox-content">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#tab-1"> 基本信息</a></li>
                    </ul>
                    <br/>
                    <div class="row">
                        <form method="post" id="articleFrom" class="form-horizontal">
                            <div class="tab-content">
                                <div id="tab-1" class="tab-pane active">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">类型：</label>
                                        <div class="col-sm-8">
                                            <label class="checkbox-inline i-checks">
                                                <input type="radio" name="art_type" value="0" {if $one['art_type']==0 || $one['art_type']==''}checked="checked"{/if}>全部</label>
                                            <label class="checkbox-inline i-checks">
                                                <input type="radio" name="art_type" value="1" {if $one['art_type']==1}checked="checked"{/if}>文科生</label>
                                            <label class="checkbox-inline i-checks">
                                                <input type="radio" name="art_type" value="2" {if $one['art_type']==2}checked="checked"{/if}>理科生</label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">标题：</label>
                                        <div class="col-sm-8">
                                            <input class="configInput form-control" name="title" minlength="2" type="text" value="{$one.title}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">发布人：</label>
                                        <div class="col-sm-8">
                                            <input class="configInput form-control" name="author" minlength="2" type="text" value="{$one.author}">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label">文章内容：</label>
                                        <div class="col-sm-8">
                                            <textarea id="content" name="content" rows="2" cols="20">{$one.content|htmlspecialchars_decode}</textarea>
                                        </div>
                                    </div>

                                    <div class="form-group" data-name="sort_order">
                                        <label class="col-sm-2 control-label">文章序号：</label>
                                        <div class="col-sm-8">
                                            <input class="configInput form-control" name="sort_order" type="number" class="configInput" value="{$one.sort_order}">
                                        </div>
                                    </div>
                                    <div class="form-group" data-name="add_time">
                                        <label class="col-sm-2 control-label">添加时间：</label>
                                        <div class="col-sm-8">
                                            <input class="configInput form-control" name="add_time" type="text" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" required="" aria-required="true" value="{$date}">
                                        </div>
                                    </div>

                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <input type="hidden" name="noticeid" value="{$one.noticeid}">
                                    <button class="btn btn-primary" onclick="ajax_submit_form('articleFrom','{:url('Notice/noticeEdit')}')" type="button">保存</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(document).ready(function () {
        $('.i-checks').iCheck({
            checkboxClass: 'icheckbox_square-green',
            radioClass: 'iradio_square-green',
        });
        editorReplace('content');
//        editorReplace('phone_content');
//        CKEDITOR.replace( 'introduce', {
//            //编辑器初始化语言
//            language : 'zh-cn',
//            //编辑器初始化功能定制
//            toolbar : [
//                ['Source'],
//                // { name: 'document', items : [ 'DocProps' ] },
//                // { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
//                // '/',
//                { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','-','RemoveFormat' ] },
//                // { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
//                { name: 'links', items : [ 'Link','Unlink' ] },
//                // { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar' ] },
//                // '/',
//                { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
//                // { name: 'colors', items : [ 'TextColor','BGColor' ] },
//                // { name: 'tools', items : [ 'Maximize', 'ShowBlocks', ] },
//            ],
//            //是否可以自行拖拽编辑器大小
//            resize_enabled : false,
//            //编辑器高度
//            height : '100px',
//            //编辑器宽度
//            // width : '1000px',
//        });
    });
</script>
<script>


    CKEDITOR.on('instanceReady', function (ev) {
        var editor = ev.editor,
                dataProcessor = editor.dataProcessor,
                htmlFilter = dataProcessor && dataProcessor.htmlFilter;
        dataProcessor.writer.selfClosingEnd = '>';
        // Make output formatting behave similar to FCKeditor
        var dtd = CKEDITOR.dtd;
        for (var e in CKEDITOR.tools.extend({}, dtd.$nonBodyContent, dtd.$block, dtd.$listItem, dtd.$tableContent)) {
            dataProcessor.writer.setRules(e,
                    {
                        indent: true,
                        breakBeforeOpen: true,
                        breakAfterOpen: false,
                        breakBeforeClose: !dtd[e]['#'],
                        breakAfterClose: true
                    });
        }
        // Output properties as attributes, not styles.
        htmlFilter.addRules(
                {
                    elements:
                    {
                        $: function (element) {
                            // Output dimensions of images as width and height
                            if (element.name == 'img') {
                                var style = element.attributes.style;
                                // delete element.attributes.style;//删除宽高
                            }

                            if (!element.attributes.style)
                            // delete element.attributes.style;//删除宽高
                                return element;
                        }
                    },
                    attributes:
                    {
                        style: function (value, element) {
                            // Return #RGB for background and border colors
                            //return convertRGBToHex(value);
                        }
                    }
                });
    });
</script>
</body>
</html>
